package cn.vcjf.weapp.api.user.service.impl;

import cn.vcjf.weapp.api.user.entity.UserDiscount;
import cn.vcjf.weapp.api.user.mapper.UserDiscountMapper;
import cn.vcjf.weapp.api.user.service.UserDiscountService;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhengzihang
 * @since 2018-09-25
 */
@Service("userDiscountService")
public class UserDiscountServiceImpl extends ServiceImpl<UserDiscountMapper, UserDiscount> implements UserDiscountService {

	@Override
	@Transactional
	public List<UserDiscount> selectUserDiscountList(Page<UserDiscount> page, UserDiscount userDiscount) {
		baseMapper.updateUserDiscountExpire(userDiscount);
		return baseMapper.selectUserDiscountList(page,userDiscount);
	}
}
